package com.bgIntlgn.client.entity.warehourse;

import yuhuibear.poat.annotations.relation.View;
import yuhuibear.poat.object.bean.Bean;

/**
 * 用户快速得到库存量的产品视图,并且带有零件信息
 * 
 * @author Simon Chen
 * 
 */

@View(name = "elementinfo_stocks", sqlToCreate = "select es.element_id as element_id, elements.name as elementname, sum(uid_stock_and_limit.quantity) as quantity "
		+ "from (select us.uid as uid, us.quantity  as quantity, "
		+ "sl.lower_limit as lowerlimit, sl.upper_limit as upperlimit "
		+ "from (select bill.uid as uid, sum(bill.quantity)  as quantity from storage_bill_records as bill"
		+ " group by bill.uid) as us left outer join storage_limits as sl on us.uid = sl.uid) as uid_stock_and_limit, element_subversions as es, elements "
		+ "where uid_stock_and_limit.uid = es.uid and es.element_id=elements.id group by es.element_id, elements.name;")
public class ElementInfoStock implements Bean {

	private Long elementId;
	private String elementname;
	private Double quantity;

	public String getElementname() {
		return elementname;
	}

	public void setElementname(String elementname) {
		this.elementname = elementname;
	}

	public Long getElementId() {
		return this.elementId;
	}

	public void setElementId(Long elementId) {
		this.elementId = elementId;
	}

	public Double getQuantity() {
		return this.quantity;
	}

	public void setQuantity(Double quantity) {
		this.quantity = quantity;
	}
}
